package com.fanxl.flink.dataset;

import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.io.CsvReader;
import org.apache.flink.api.java.operators.DataSource;
import org.apache.flink.api.java.tuple.Tuple3;

/**
 * @description:
 * @author: fanxiaole
 * @date: 2022/3/29 18:00
 */
public class SourceApp {

    public static void main(String[] args) throws Exception {
        ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
        CsvReader csvReader = env.readCsvFile("data/people.csv");
        DataSource<Tuple3<String, Integer, String>> stream = csvReader
                .fieldDelimiter(";")
                .ignoreFirstLine()
                .types(String.class, Integer.class, String.class);
        stream.print();

    }

}
